package com.bjsxt.IO;

import java.io.FileInputStream;

public class FirstDemo {
    public static void main(String[] args){
        FileInputStream fileInputStream = null;
        try{
            fileInputStream =new FileInputStream("G:\\2021-09-01-java学习\\java300\\src\\com\\bjsxt\\IO\\a.txt");
            StringBuilder stringBuilder = new StringBuilder();
            int temp=0;
            while ((temp=fileInputStream.read())!=-1){
                System.out.println(temp);
                stringBuilder.append((char)temp);
            }
            System.out.println(stringBuilder);
        }catch (Exception e){
            e.printStackTrace();
        }finally{
            if (fileInputStream!=null){
                try {
                    fileInputStream.close();
                }catch (Exception e){
                    e.printStackTrace();
                }
            }
        }
    }
}
